<?php

namespace App\Transformers;

use App\Models\Transportation;

class TransportationTransformer extends Transformer
{
    /**
     * @param User $user
     * @return array
     */
    public function transform(Transportation $transportation)
    {
        return [
            'user_id' => $transportation->user_id,
            'attendance_no' => $transportation->attendance_no,
            'user_name' => $transportation->users->name,
            'telephone' => $transportation->users->telephone,
            'riding_time' => $transportation->riding_time,
            'origin' => $transportation->origin,
            'destination' => $transportation->destination,
            'total_price' => $transportation->total_price,
            'distance' => $transportation->distance,
            'duration' => $transportation->duration,
            'note' => $transportation->note,
            'additional' => $transportation->additional,
            'city' => $transportation->city,
        ];
    }
}
